﻿using System.Threading.Tasks;

namespace Sidvall.Security
{
    public class UserResponseStrategyManager
    {
        #region Public Members

        public Sidvall.Security.IUserResponseStrategy UserResponseStrategy { get; set; }

        #region CurrentUserResponse

        public string CurrentUserResponse
        {
            get
            {
                return this.UserResponseStrategy?.CurrentUserResponse;
            }
        }

        #endregion

        #region LoadUserResponseAsync

        public async Task LoadUserResponseAsync()
        {
            if (this.UserResponseStrategy != null)
                await this.UserResponseStrategy.LoadUserResponseAsync().ConfigureAwait(false);
        }
        public async Task LoadUserResponseAsync(string userResponse, bool storeInFile)
        {
            if (this.UserResponseStrategy != null)
                await this.UserResponseStrategy.LoadUserResponseAsync(userResponse, storeInFile).ConfigureAwait(false);
        }

        #endregion

        #region ToString

        public override string ToString()
        {
            return "UserResponseStrategyManager - Sidvall.Security.IUserResponseStrategy";
        }

        #endregion

        #endregion
        #region Constructors

        public UserResponseStrategyManager(Sidvall.Security.IUserResponseStrategy userResponseStrategy)
        {
            this.UserResponseStrategy = userResponseStrategy;
        }

        #endregion
    }
}
